package com.qf.lanzhou.shop.api.service;

import com.qf.lanzhou.shop.pojo.entity.ReceivingAddress;

import java.util.List;

/**
 * @author jack
 * 收货地址逻辑层
 */
public interface ReceivingAddressService {
    /**
     * 获取当前用户的收货地址
     *
     * @param userId
     * @return
     */
    List<ReceivingAddress> getAddressByUserId(Long userId);

    /**
     * 增加收货信息
     *
     * @return 成功返回false全部都是
     */
    boolean addAddress(ReceivingAddress receivingAddress);

    /**
     * 删除收货地址
     *
     * @param userId
     * @return
     */
    boolean delectAddress(Long userId);

    /**
     * 修改收货地址
     *
     * @param receivingAddress
     * @return
     */
    boolean updateAddress(ReceivingAddress receivingAddress);

    boolean forOne(Long id);

    boolean forZero(Long userId);

    /**
     * 通过ID获取
     * @param id
     * @return
     */
    ReceivingAddress getAddressById(Long id);
}
